package com.gfxy.modules.common.service.impl;

import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.gfxy.modules.common.entity.TotalScore;
import com.gfxy.modules.common.mapper.TotalScoreMapper;
import com.gfxy.modules.common.service.ITotalScoreService;


import com.gfxy.modules.common.vo.SummaryOrgTotalScoreVo;
import com.gfxy.modules.common.vo.SummaryTotalScoreVo;
import com.gfxy.modules.common.vo.TotalScoreOrg;
import com.gfxy.modules.common.vo.TotalScoreVo;
import org.jeecg.common.api.vo.Result;
import org.springframework.stereotype.Service;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;

import java.util.List;
import java.util.Map;

/**
 * @Description: gfxy_t_total_score
 * @Author: jeecg-boot
 * @Date:   2021-11-17
 * @Version: V1.0
 */
@Service
public class TotalScoreServiceImpl extends ServiceImpl<TotalScoreMapper, TotalScore> implements ITotalScoreService {


    @Override
    public List<Map> getClassificationInfoAndScoreByDateUserProjectId(String date, String username,String projectId) {

        List<Map> scores = this.baseMapper.getClassificationInfoAndScoreByDateUserProjectId(date,username,projectId);

        return scores;
    }

    @Override
    public List<Map> getScoreAndRankedByProjectId(String date, String username, String projectId) {
        return this.baseMapper.getScoreAndRankedByProjectId(date,username,projectId);
    }

    @Override
    public List<Map> getScoreAndRankedByProjectIdAndTeacherType(String date, String username, String projectId,String teacherType) {
        return this.baseMapper.getScoreAndRankedByProjectIdAndTeacherType(date,username,projectId,teacherType);
    }

    @Override
    public List<Map> getClassificationScoreAndRankedByProjectId(String date, String username, String projectId) {
        return this.baseMapper.getClassificationScoreAndRankedByProjectId(date,username,projectId);
    }

    @Override
    public List<Map> getClassificationScoreAndRankedByProjectIdAndTeacherType(String date, String username, String projectId,String teacherType) {
        return this.baseMapper.getClassificationScoreAndRankedByProjectIdAndTeacherType(date,username,projectId,teacherType);
    }

    @Override
    public IPage<TotalScoreVo> getEducationTotalScore(String date, String orgCode, Integer pageNo, Integer pageSize) {
        IPage<TotalScoreVo> page = new Page<>(pageNo,pageSize);
        return this.baseMapper.getEducationTotalScoreByDateAndOrgCode(page,date,orgCode);
    }

    @Override
    public List<SummaryOrgTotalScoreVo> getOrgAllYearSummaryTotalScoreByDate(String date, String projectId) {
        return this.baseMapper.getOrgAllYearSummaryTotalScoreByDate(date);
    }

    @Override
    public IPage<SummaryTotalScoreVo> getAllYearSummaryTotalScoreByDateAndOrgCode(String date, String orgCode, Integer pageNo, Integer pageSize) {
        IPage<SummaryTotalScoreVo> page = new Page<>(pageNo,pageSize);
        return this.baseMapper.getAllYearSummaryTotalScoreByDateAndOrgCode(page,date,orgCode);
    }


    @Override
    public List<SummaryTotalScoreVo> getAllSummaryTotalScoreByDateAndOrgCodeForList(String date, String orgCode) {
        return this.baseMapper.getAllSummaryTotalScoreByDateAndOrgCodeForList(date,orgCode);

    }

//    @Override
//    public IPage<TotalScoreVo> getEducationAndServiceByDateAndOrgCode(String date, String orgCode,Integer pageNo,Integer pageSize) {
//
//        IPage<TotalScoreVo> page = new Page<>(pageNo,pageSize);
//        IPage<TotalScoreVo> result = this.baseMapper.getTotalScoreForTeachingTeacherByDataAndOrgCodeAndType(page,date,orgCode,5);
//        return result;
//
//    }
}
